home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / lastcall.dxr / 00002_Ice Scoop Behavior.ls < prev    next >
Encoding:
Text File  |  2000-03-27  |  1.1 KB  |  61 lines

  1. property pOrigMember, pTimer, pSpr, pTilt, pIngredient
  2. global gFloatSprite
  3.  
  4. on beginSprite me
  5.   pSpr = sprite(me.spriteNum)
  6.   pOrigMember = pSpr.member
  7.   pIngredient = #ice
  8.   pTilt = #left
  9. end
  10.  
  11. on mReplaceIt me
  12.   pSpr.visible = 1
  13. end
  14.  
  15. on mouseDown me
  16.   if the doubleClick then
  17.     exit
  18.   end if
  19.   if draggingAnything() then
  20.     replaceDraggingAnything()
  21.     exit
  22.   end if
  23.   menuDown = nowTicks()
  24.   mPickMeUp(me)
  25. end
  26.  
  27. on mPickMeUp me, noToolTip, pickupLoc
  28.   global gIceSounds
  29.   replaceDraggingAnything()
  30.   returnToBar(VOID, 1)
  31.   pSpr.visible = 0
  32.   if gIceSounds then
  33.     iceSound = "ice_scoop"
  34.   else
  35.     iceSound = VOID
  36.   end if
  37.   sendSprite(gFloatSprite, #mPickUpBottle, pSpr, VOID, VOID, pIngredient, VOID, iceSound, pickupLoc)
  38. end
  39.  
  40. on mouseEnter me
  41.   if not draggingAnything() then
  42.     pTimer = nowTicks()
  43.     showToolTip(pSpr, pIngredient)
  44.   end if
  45. end
  46.  
  47. on mouseLeave me
  48.   if not draggingAnything() then
  49.     hideToolTip()
  50.   end if
  51. end
  52.  
  53. on mouseWithin
  54.   if draggingAnything() then
  55.   else
  56.     if tipTickRange(pTimer) then
  57.       forceToolTip(pSpr, pIngredient)
  58.     end if
  59.   end if
  60. end
  61.